-
Notifications
You must be signed in to change notification settings - Fork 168
Dynamic message publishers and subscribers #492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Dynamic message publishers and subscribers #492
Conversation
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
15f1a9b
to
470396b
Compare
I've started using this pull request in one of my projects and I have noticed an issue with messages containing sequences of messages (for instance test_msgs/msg/UnboundedSequences). The program panics when trying to access an empty sequence of messages. To reproduce: let message_type = MessageTypeName {
package_name: "test_msgs".to_owned(),
type_name: "UnboundedSequences".to_owned(),
};
let mut msg = DynamicMessage::new(message_type).unwrap();
let value = msg.get("basic_types_values"); In |
This reminds me of #407. |
Signed-off-by: Luca Della Vedova <[email protected]>
Hello, hope this is working well for you! I fixed the panic for both mutable and non mutable access and added (+ expanded) your snippet as a regression test in e21a4a7, let me know if it works for you :) |
Signed-off-by: Luca Della Vedova <[email protected]>
This PR revives #262 from @nnmm (as evident from the first commit that actually does 95% of the work!), with a few minor updates:
I'll admit that most of the code under
field_access
(where the casting and reinterpreting of arbitrary messages is done) is a bit out of my comfort zone, however loopback tests, message serialization and deserialization seem to work so it is at least doing something sensible.Following the initial implementation this is all under a
dyn_msg
feature flag, but I'm not 100% convinced that the additional[cfg(feature = "dyn_msg")]
directives that are scattered throughout the codebase are worth it. Specifically on my (very overpowered) machine a clean build withdyn_msg
enabled builds a total of 93 packages while a clean build without the feature builds 89 packages. The compile time difference itself is hard to detect.Originally, the PR was split into a separate one that only included the message structure. I'm happy to split this into smaller chunks if that makes it easier to review but I thought I would show what a full implementation looks like first.
This only tackles messages, publishers and subscribers. Services (and actions) are left as a future implementation.